require_once("common.php");
require_once("main.php");
require_once "allTplParam.php";
//------------------------友情链接
require_once("includes/allLink.php");
//------------------------友情链接
$cid=intval(trim($_GET["cid"]));
$sql="select * from db_docclass where rootid=1 order by ordernum";
$query=$DB->query($sql);
$i=1;
while($result=$DB->fetch_array($query))
{
$classid=$result["id"];
$MenuStr .="
".$result["classname"]." ";
}
$tpl->assign("MenuStr",$MenuStr);
if (empty($cid)) $cid=12;
$sql="select * from db_docclass where id='$cid'";
$query=$DB->query($sql);
$result=$DB->fetch_array($query);
$tpl->assign("curTitle",$result["classname"]);
$pagePos="首页 新闻资讯";
$tpl->assign("pagePos",$pagePos);
$topTitle = "新闻资讯";
$tpl->assign("topTitle",$topTitle);
$csql="select * from db_doc where classid='$cid' order by id desc";
$cquery=$DB->query($csql);
$totalRDS=@$DB->num_rows($cquery);
$pageno=$_GET["pageno"];
if (!isset($pageno))
{
$pageno=1;
}
$startpos=($pageno-1)*$maxline;
$totalPage=ceil($totalRDS/$maxline);
$csql=$csql." limit $startpos,$maxline";
$cquery=$DB->query($csql);
while($cresult=$DB->fetch_array($cquery))
{
$title="".$cresult["title"]."";
$theNews[]=array("title"=>$title,"showDate"=>$cresult[showDate]);
}
$tpl->assign("theNews",$theNews);
$URL=getUrl();
$mpage="共".$totalRDS."条记录 ".mtilPage(4,$pageno,$totalPage,$URL);
$tpl->assign("mpage",$mpage);
//---------------页面标题、KEYWORDS-------------
$pageTitle="新闻资讯".$_SGLOBAL["page_title"];
$pagekeywords=$_SGLOBAL["page_keyword"];
$tpl->assign("pageTitle",$pageTitle);
$tpl->assign("pagekeywords",$pagekeywords);
//---------------页面标题、KEYWORDS-------------
$tplpath="";
$tpl->display($tplpath."newsList.html");
?>